package com.gitee.tje.waving.aop;

import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;

/**
 * @author taojiaen
 * @date 2018-03-08 09:02
 */
public class ReflectUtils {

    private static Set<String> BASE_METHOD_SET = new HashSet<>();

    static {
        for (Method method : Object.class.getMethods()) {
            BASE_METHOD_SET.add(method.getName());
        }
    }

    /**
     * 判断方法是不是toString , hashCode之类的基本方法
     */
    public static boolean isObjectMethod(Method method) {
        return BASE_METHOD_SET.contains(method.getName());
    }
}
